<template>
	<view class="container">
		<tui-list-view unlined="all">
			<tui-list-cell  v-for="(item,index) in logList" :key="index"  :hover="false" :arrow="false" :lineLeft="false" unlined>
				<view class="log-cell">
					<block v-if="item.type == 1">
						<view class="log-cell-left">
							<view class="log-cell-title">充值 {{item.amount}}元</view>
							<view class="log-cell-date">{{item.create_time}}</view>
						</view>
						<view class="log-cell-right">
							<view v-if="item.status == 0">未支付</view>
							<view v-if="item.status == 1">已支付</view>
						</view>
					</block>
					
					<block v-else-if="item.type == 2">
						<view class="log-cell-left">
							<view class="log-cell-title">提现 {{item.amount}}元</view>
							<view class="log-cell-date">{{item.create_time}}</view>
						</view>
						<view class="log-cell-right">
							<view v-if="item.status == 0">未打款</view>
							<view v-if="item.status == 1">已打款</view>
						</view>
					</block>
					
					<block v-else-if="item.type == 3">
						<view class="log-cell-left">
							<view class="log-cell-title">扣除 {{item.amount}}元</view>
							<view class="log-cell-date">{{item.create_time}}</view>
						</view>
						<view class="log-cell-right">
							<tui-button type="warning" :size="25" height="40rpx" width="100rpx" @click="viewRemark(item.remark)">原因</tui-button>
						</view>
					</block>
				</view>
				
			</tui-list-cell>
		</tui-list-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				logList : []
			}
		},
		onLoad() {
			},
		onShow() {
			this.getBailLog()
		},
		methods: {
			getBailLog(){
				this.$request.get('technicalbail.bailLog',{}).then(res => {
					if(res.errno == 0) {
						this.logList = res.data
					}
				})
			},
			viewRemark(text){
				uni.showModal({
					title:"扣款原因",
					content:text,
					showCancel:false,
					success:function(){
						
					}
				})
			}
		}
	}
</script>

<style>
	.container {
		width: 100%;
		padding-bottom: 48rpx;
		box-sizing: border-box;
	}	
	
	.log-cell{
		padding: 20rpx;
		box-sizing: border-box;
		margin-bottom: 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	
	.log-cell-left {
		/* width: 400rpx; */
		/* background-color: teal; */
	}
	.log-cell-right {
		/* width: 100rpx; */
		text-align: right;
		/* background-color: aquamarine; */
	}
	
	.log-cell-title{
		font-size: 30rpx;
	}
	
	.log-cell-date{
		color: #a8abab;
	}
	
	
</style>
